<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>
    var lis = document.getElementsByTagName("li");
    var contents =document.querySelectorAll(".content>div");
    for(var i=0;i<lis.length;i++){
        lis[i].index=i;
        lis[i].onclick=function(){
            for(var k=0;k<lis.length;k++){
                lis[k].className="";
            }
            this.className="current";
            for(var m=0;m<contents.length;m++){
                contents[m].style.display="none";
            }
            contents[this.index].style.display="block";
        }
    }        
</script>
</body>
</html>